/**
 * Created by sjg on 2017/8/7.
 */
var express = require('express');
var router = express.Router();
var superagent = require('superagent');// 使用了superagent来发起请求
var ItbFeedbackModel = require('../../../common/mysql/mapping/ItbFeedbackModel');
var ItbTradeOrderDetailModel = require('../../../common/mysql/mapping/ItbTradeOrderDetailModel');
var ItbActivityRModel = require('../../../common/mysql/mapping/ItbActivityRModel');

var CONFIG = require('../../../common/config');
var CODE = require('../../../common/code');
var checkUtil = require('../util/checkUtil');
var printUtil = require('../util/printUtil');
var payUtil = require('../util/payUtil');
var activityUtil = require('../util/activityUtil');
var usersUtil = require('../util/usersUtil');
var luaUtil = require('../util/luaUtil');
var async = require('async');
var moment = require("moment");
//------------------------------------------------------------------------------------------------
// CODE.OPERATION_SUCCESS
// CODE.OPERATION_FAILED

//----------------------------------------------------------------------
/**
 * 获取预结算秒杀商品信息
 * 参数: device
 * 参数: userId
 * 参数: actItemId: 秒杀商品 id
 * 参数[可选]: couponId: 优惠券唯一标识, -1标识不使用优惠券
 * 返回值:
 * {
 * "success": 1,
 * "msg": "成功",
 * "data": {
 *  "preOrderInfo": {
 *   "totalFee": 299,  // 总费用
 *   “itemFee” : 299,  // 商品费用
 *   "actItemInfo" :  // 活动商品信息
 *     {
 *            "id" : 1,
 *            "itemId" : 999,
 *            "typeL" : 1010,
 *            "typeM" : 10100100,
 *            "thumb" : "http://0ss-img.jpg",
 *            "title" : "logo 商品名称",
 *            "orgPrice" : 998,
 *            "actPrice" : 288,
 *            "qty" : 1,
 *            "rest_qty" : 1,
 *      },
 *   "couponCnt": 2, // 可用优惠券个数
 *   "couponInfo":
 *     {
 *       "id": 986,
 *       "code": "QWERTPOIUYEV",
 *       "type_desc": "抵扣券",
 *       "discount_desc": "5.0元",
 *       "trade_type": 10,
 *       "expiry_time": "2017-03-05",
 *       "coupon_desc": "暂不抵扣运费",
 *       "reason": "",
 *       "limit_type": 1010
 *     }
 *   }
 *  }
 * }
 */
function getActivityPreOrderInfo_v6_1(req, res, next) {
    var device = checkUtil.numberFromReq(req, 'device');
    var uuid = checkUtil.stringFromReq(req, 'uuid');

    var userId = checkUtil.numberFromReq(req, 'userId')||0;
    var actItemId = checkUtil.numberFromReq(req, 'actItemId')||0;
    var couponId = checkUtil.numberFromReq(req, 'couponId')||0;
    couponId = couponId <= 0 ? 0 : couponId;

    if(userId <= 0 || device<0 || actItemId<=0) {
        return activityUtil.ret_func_json(0, '参数错误', {}, res);
    }

    activityUtil.getActivityPreOrderInfo_v6_1(userId, actItemId, couponId, function (error, retInfo) {
        if (error) {
            console.log('v5/activity.js getActivityPreOrderInfo_v6_1 Err: '+error);
            return activityUtil.ret_func_json(0,CODE.OPERATION_FAILED,{},res);
        }

        return activityUtil.ret_func_json(1,CODE.OPERATION_SUCCESS, {preOrderInfo:retInfo},res);
    });
}
router.get('/getActivityPreOrderInfo_v6_1', getActivityPreOrderInfo_v6_1);
router.post('/getActivityPreOrderInfo_v6_1', getActivityPreOrderInfo_v6_1);

//------------------------------------------------------------------------------------------------
/**
 * 获取预结算秒杀商品可使用/不可使用优惠券列表
 * 参数 device: 请求来源
 * 参数 userId: 用户唯一标识
 * 参数 actItemId: 秒杀商品 id
 * 参数 flg: 0,标识获取不可用优惠券, 1, 标识可使用优惠券, 默认为0
 * 参数: pageNum
 * 参数: pageSize
 * 参数 withTotalPage[可选]: 0, 标识不获取总页数, 1. 标识获取总页数, 默认为0
 * 返回结果	{
 * "success": 1,
 *  "msg": "成功",
 * "data": {
 *  "coupons": [
 *      {
 *        "id": 986,
 *        "code": "QWERTPOIUYEV",
 *        "type_desc": "抵扣券",
 *        "discount_desc": "5.0元",
 *        "trade_type": 20,
 *        "expiry_time": "2017-03-05",
 *        "coupon_desc": "暂不抵扣运费",
 *        "reason": "",
 *        "limit_type": 4
 *      }
 *     ],
 *     "totalPage": 1
 *   }
 * }
 * */
function getActivityItemCoupons_v6_1(req, res, next) {

    var device = checkUtil.stringFromReq(req, 'device');
    var userId = checkUtil.numberFromReq(req, "userId") || 0;
    var actItemId = checkUtil.numberFromReq(req, "actItemId") || 0;
    var flg = checkUtil.numberFromReq(req, "flg") || 0;
    if(flg<0) flg=0;
    var pageNum = checkUtil.numberFromReq(req, 'pageNum')||0;
    var pageSize = checkUtil.numberFromReq(req, 'pageSize')||12;
    var withTotalPage = checkUtil.numberFromReq(req, "withTotalPage") || 0;
    if(withTotalPage<0) withTotalPage=0;

    if(userId <=0 || actItemId<=0) {
        return activityUtil.ret_func_json(0, '参数错误', {}, res);
    }

    activityUtil.getSeckillCouponInfo_v6_1(userId, actItemId, flg, pageNum, pageSize, function(getErr, couponInfo){
        if(getErr) {
            console.log("/v5/activity.js [getActivityItemCoupons_v6_1] getSeckillCouponInfo_v6_1 Err: " + getErr);
            return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
        }

        var retData = {coupons: couponInfo};
        if(withTotalPage) {
            activityUtil.getSeckillCouponInfoCnt_v6_1(userId, actItemId, flg, function (getErr2, cnt) {
                if(getErr2) {
                    console.log('v5/activity.js [getActivityItemCoupons_v6_1] getSeckillCouponInfoCnt_v6_1 Err: '+getErr2);
                    return activityUtil.ret_func_json(0,CODE.OPERATION_FAILED,{},res);
                }

                retData.totalPage = 0;
                if(cnt>0) {
                    retData.totalPage = Math.floor((cnt-1)/pageSize)+1;
                }
                return activityUtil.ret_func_json(1,CODE.OPERATION_SUCCESS,retData,res);
            });

        } else {
            return activityUtil.ret_func_json(1,CODE.OPERATION_SUCCESS,retData,res);
        }
    });
}
router.get('/getActivityItemCoupons_v6_1', getActivityItemCoupons_v6_1);
router.post('/getActivityItemCoupons_v6_1', getActivityItemCoupons_v6_1);

//------------------------------------------------------------------------------------------------
/**
 * 获取秒杀商品微信支付参数
 * 参数 device: 请求来源
 * 参数 userId: 用户唯一标识
 * 参数 actItemId: 秒杀商品 id
 * 参数 couponId[可选]: 优惠券唯一标识, -1标识不使用优惠券
 * 返回结果	"{
 * "success": 1,
 *  "msg": "成功",
 * "data": {
 *        "orderId" : 981, // 秒杀订单 id
 *        "orderNo" : "ASDFGHJKL",
 *        "prepayId": 789,
 *        "nonceStr": "qwertyuiopsdfghjkl",
 *        "timeStamp": 999990909090,
 *        "sign": "QWKSJDFHGJHDFHHDHH"
 *   }
 * }
 * */
function getActivityItemPaymentInfo_v6_1(req, res, next) {

    var device = checkUtil.stringFromReq(req, 'device');
    var userId = checkUtil.numberFromReq(req, "userId") || 0;
    var actItemId = checkUtil.numberFromReq(req, "actItemId") || 0;
    var couponId = checkUtil.numberFromReq(req, "couponId") || -1;

    if(userId<=0 || actItemId<=0) {
        return activityUtil.ret_func_json(0, '参数错误', {}, res);
    }

    // 检查商品是否可下单
    (new ItbActivityRModel).chkActItemValid(actItemId, function(chkErr, bValid){
        if(chkErr){
            console.log("/v5/activity.js [getActivityItemPaymentInfo_v6_1] chkActItemValid Err: " + chkErr);
            return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
        }

        if(!bValid) {
            return activityUtil.ret_func_json(0, '该商品暂时无法下单', {}, res);
        }

        // 锁定商品
        luaUtil.lockActivityItem(actItemId, userId, function(lockErr, lockRet){
            if(lockErr) {
                console.log("/v5/activity.js [getActivityItemPaymentInfo_v6_1] lockActivityItem Err: " + lockErr);
                var errMsg = typeof lockErr == "string" ? lockErr :  CODE.OPERATION_FAILED;
                return activityUtil.ret_func_json(0, errMsg, {}, res);
            }

            // 创建秒杀订单
            activityUtil.crtSeckillOrder_v6_1(device, userId, actItemId, couponId, function(crtErr, crtOrderInfo){
                if(crtErr) {
                    console.log("/v5/activity.js [getActivityItemPaymentInfo_v6_1] crtSeckillOrder_v6_1 Err: " + crtErr);
                    return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
                }

                if(crtOrderInfo && crtOrderInfo.orderId>0) {
                    // 调用微信支付通用接口
                    payUtil.getUnifiedOrder(device, userId, null, crtOrderInfo.orderId, 50/*秒杀订单*/, function(getErr, getRet){
                        if(getErr){
                            return activityUtil.ret_func_json(0,CODE.OPERATION_FAILED,{},res);
                        }

                        var data = {
                            orderId: crtOrderInfo.orderId,
                            orderNo: crtOrderInfo.orderNo,
                            prepayId: '',
                            nonceStr: '',
                            timeStamp: '',
                            sign: ''
                        };
                        if(getRet) {
                            data.prepayId = getRet.prepayId||'';
                            data.nonceStr = getRet.nonceStr||'';
                            data.timeStamp = getRet.timeStamp||'';
                            data.sign = getRet.sign||'';
                        }
                        return activityUtil.ret_func_json(1,CODE.OPERATION_SUCCESS,data,res);
                    });

                } else {
                    return activityUtil.ret_func_json(0,CODE.OPERATION_FAILED,{},res);
                }
            });
        });
    });
}
router.get('/getActivityItemPaymentInfo_v6_1', getActivityItemPaymentInfo_v6_1);
router.post('/getActivityItemPaymentInfo_v6_1', getActivityItemPaymentInfo_v6_1);

//------------------------------------------------------------------------------------------------
/**
 * 获取用户秒杀列表
 * 参数 device: 请求来源
 * 参数 userId: 用户唯一标识
 * 参数 state: 暂定: 10, 可用, 20 已用, 30 失效, 40 待支付
 * 参数 pageNum: 页码
 * 参数 pageSize: 页容量
 * 返回结果	"{
 * "success": 1,
 *  "msg": "成功",
 * "data": {
 *  "list": [
 *      {
 *        "orderId" : 998, // 秒杀订单 id
 *        "orderNo" : "JOWENGEB97", // 秒杀订单号
 *        "itemId": 999,
 *        "state": 10,
 *        "currentTime": 1490769515, // 时间戳:当前时间(秒)
 *        "cancelTime": 1490769515 // 时间戳:订单取消时间(秒)
 *        "typeL": 1010,
 *        "typeM": 10100100,
 *        "thumb": "http://0ss-img.jpg",
 *        "title": "logo 商品名称”,
 *        "usedTime" : "2017-07-09",// 暂时去掉
 *        "expireTime" : “2017-08-09",
 *        "createTime" : "2017-07-09",
 *      }
 *     ]
 *   }
 * }
 *
 * 测试地址: http://localhost:3000/v5/activity/getUserActivityList_v6_1?device=1&userId=415198&pageNum=0&pageSize=12&state=20
 * */
function getUserActivityList_v6_1(req, res, next) {

    var device = checkUtil.stringFromReq(req, 'device');
    var userId = checkUtil.numberFromReq(req, "userId") || 0;
    var pageNum = checkUtil.numberFromReq(req, "pageNum") || 0;
    var pageSize = checkUtil.numberFromReq(req, "pageSize") || 12;
    var state = checkUtil.numberFromReq(req, "state") || 10;

    if(userId <=0) {
        return activityUtil.ret_func_json(0, '参数错误', {}, res);
    }

    activityUtil.getUserActivityList_v6_1(userId,state,pageNum,pageSize,function(getErr, getRet){
        if(getErr) {
            console.log("/v5/activity.js [getUserActivityList_v6_1] getUserActivityList_v6_1 Err: " + getErr);
            return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
        }

        return activityUtil.ret_func_json(1, CODE.OPERATION_SUCCESS, {list:getRet||[]}, res);
    });
}
router.get('/getUserActivityList_v6_1', getUserActivityList_v6_1);
router.post('/getUserActivityList_v6_1', getUserActivityList_v6_1);

//------------------------------------------------------------------------------------------------
/**
 * 获取秒杀信息
 * 参数: device	"0表示从p0 表示从pc来的请求
 * 1 标识一键生成iOS端
 * 2 标识一键生成android端
 * 3  标识一键生成 app 嵌入网页
 * 4 标识一键生成 web 端
 * 5 标识一键生成微信端
 *
 * 101 表示pc美化大师/102表示pc wps/103表示wps android/104表示wps ios
 * 201 标识利楚商务
 * 301 标识酒单网"
 * 参数[可选]: id	 秒杀场次 id, 不传递则获取第一个秒杀场次信息
 * 参数: pageNum	 页码
 * 参数: pageSize	 页容量
 * 参数: typeMs	" 指定二级分类数组的 json 字符串, 标记获取秒杀场次的二级分类范围
 * 当前版本固定传递[10110100, 10110200, 10100100]"
 * 返回结果	"{
 * "success": 1,
 *  "msg": "成功",
 * "data": {
 *  	"activities" : [{"id" : 1,"title" : "logo 专场"},{"id" : 5,"title" : "百度百科专场"}],
 *     "activity": {
 *        "id" : 1, // 秒杀项目 id"title": "logo 秒杀","desc": "每个 logo 仅一件, 抢完下架","currentTime": 197009876,"startTime": 9978990000,"endTime": 98989999999,"state" : 30, // 10未开场, 20已开场, 30 已结束
 *        "items": [
 *        	{
 *        		"id" : 1, // 活动商品唯一标识
 *        		"itemId" : 999, // 对应商品唯一标识
 *        		"typeL" : 1010, // 商品一级分类
 *        		"typeM" : 10100100, // 商品二级分类
 *        		"thumb" : "http://0ss-img.jpg", // 商品缩略图
 *        		"title" : "logo 商品名称”, // 商品名称
 *        		"orgPrice" : 998, // 原价
 *        		"actPrice" : 288, // 活动价
 *        		"qty" : 1, // 总数量
 *        		"rest_qty" : 1, // 剩余数量
 *         	}]}}}"
 * 测试地址: http://localhost:3000/v5/activity/getActivityItemList_v6_1?device=1&pageNum=0&pageSize=10&typeMs=[10110100,10110200,10100100]
 * */
function getActivityItemList_v6_1(req, res, next) {

    var device = checkUtil.stringFromReq(req, 'device');
    var id = checkUtil.numberFromReq(req, "id");
    var pageNum = checkUtil.numberFromReq(req, "pageNum") || 0;
    var pageSize = checkUtil.numberFromReq(req, "pageSize") || 12;
    var typeMs = checkUtil.stringFromReq(req, "typeMs");
    if(!device || device <=0 ) {
        return activityUtil.ret_func_json(0, '参数错误', {}, res);
    }
    if(!typeMs || typeMs.length == 0) {
        return activityUtil.ret_func_json(0, '参数错误', {}, res);
    }
    typeMs = JSON.parse(typeMs);
    if(!typeMs || typeMs.length == 0) {
        return activityUtil.ret_func_json(0, '参数错误', {}, res);
    }

    // 1. 获取已开场次列表
    activityUtil.getCurrentActivityList(function(getActsErr, activitys){
        if(getActsErr) {
            console.log("/v5/activity.js [getActivityItemList_v6_1] getCurrentActivityList err: " + getActsErr);
            return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
        }
        // 暂无场次
        if(!activitys || activitys.length == 0) {
            var obj = {activitys : activitys || [], activity : {}};
            return activityUtil.ret_func_json(1, CODE.OPERATION_SUCCESS, obj, res);
        }
        // 2. 获取指定场次列表
        id = id <= 0 ? activitys[0].id : id;
        activityUtil.getActivityAndItems(id, pageNum, pageSize, function(getActItemsErr, activity){
            if(getActsErr) {
                console.log("/v5/activity.js [getActivityItemList_v6_1] getActivityAndItems err: " + getActItemsErr);
                return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
            }
            var retJson = {
                activitys : activitys,
                activity : activity
            };
            // 3. 若请求场次已结束, 在列表内不存在, 也需要加到 activitys 内
            var needPush = true;
            for(var i=0; i < activitys.length; i++) {
                if(activity.id == activitys[i].id) {
                    needPush = false;
                    break;
                }
            }
            if(needPush) retJson.activitys.push({id:activity.id, title:activity.title});
            return activityUtil.ret_func_json(1, CODE.OPERATION_SUCCESS,retJson, res);
        });
    });
}
router.get('/getActivityItemList_v6_1', getActivityItemList_v6_1);
router.post('/getActivityItemList_v6_1', getActivityItemList_v6_1);

//------------------------------------------------------------------------------------------------
/**
 * 获取秒杀商品详情
 * 参数: device	"0表示从p0 表示从pc来的请求
 * 1 标识一键生成iOS端
 * 2 标识一键生成android端
 * 3  标识一键生成 app 嵌入网页
 * 4 标识一键生成 web 端
 * 5 标识一键生成微信端
 *
 * 101 表示pc美化大师/102表示pc wps/103表示wps android/104表示wps ios
 * 201 标识利楚商务
 * 301 标识酒单网"
 * 参数: actId	 秒杀场次唯一标识
 * 参数: actItemId	活动商品唯一标识
 * 返回	"{
 *  "success": 1,
 * "msg": "成功",
 *  "data": {
 *     "activity" : {"currentTime": 197009876,"startTime": 9978990000,"endTime": 98989999999,"state" : 30,},
 *    "itemContent" : {
 *            "id" : 1, // 秒杀项目 id
 *            "itemId" : 999,
 *            "typeL" : 1010,
 *            "typeM" : 10100100,
 *            "title" : "logo 商品名称",
 *            "orgPrice" : 998,
 *            "actPrice" : 288,
 *            "qty" : 1,
 *            "rest_qty" : 1,
 *            "thumbs" : ["http://0ss-img.jpg"],
 *            "desc" : "商品说明, 如色差小于百分之十不属于残次品"}}"
 * 测试地址: http://localhost:3000/v5/activity/getActivityItemContent_v6_1?device=1&actId=1&actItemId=1
 * */
function getActivityItemContent_v6_1(req, res, next) {

    var device = checkUtil.stringFromReq(req, 'device');
    var actId = checkUtil.numberFromReq(req, "actId") || 0;
    var actItemId = checkUtil.numberFromReq(req, "actItemId") || 0;

    // 1.获取秒杀项目信息
    activityUtil.getActItemContent(actItemId, function(findItemErr, item){
        if(findItemErr) {
            console.log("/v5/activity.js [getActivityItemContent_v6_1] getActItemContent err: " + findItemErr);
            return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
        }
        // 2. 获取秒杀场次信息
        activityUtil.getActivityBriefInfo(actId, function(getActErr, activity){
            if(getActErr) {
                console.log("/v5/activity.js [getActivityItemContent_v6_1] getActivityInfo err: " + getActErr);
                return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
            }
            return activityUtil.ret_func_json(1, CODE.OPERATION_SUCCESS,{activity : activity, itemContent : item}, res);
        });
    });
}
router.get('/getActivityItemContent_v6_1', getActivityItemContent_v6_1);
router.post('/getActivityItemContent_v6_1',getActivityItemContent_v6_1);

/**
 *
 * 参数: device	"0表示从p0 表示从pc来的请求
 * 1 标识一键生成iOS端
 * 2 标识一键生成android端
 * 3  标识一键生成 app 嵌入网页
 * 4 标识一键生成 web 端
 * 5 标识一键生成微信端
 *
 * 101 表示pc美化大师/102表示pc wps/103表示wps android/104表示wps ios
 * 201 标识利楚商务
 * 301 标识酒单网"
 * 参数: userId	 用户唯一标识
 * 参数: orderId	 秒杀订单id
 * 返回结果	{"success":1,"msg":"成功","data":{"docId":989,"coreStructure":{"ct":903,"name":"资源分享标准模板","root":{"p":0,"id":1,"children":[{"id":11,"o":0,"h":0,"p":0,"ct":904,"type":1,"value":{"min":1,"value":"","ct":808,"max":20,"id":0,"type":20},"topic":"邮箱","child_max":1,"children":[],"kind":3,"relations":[{"page_index":0,"obj_id":4}]}],"ct":904,"child_max":1,"topic":"资源分享","value":{"min":1,"value":"","ct":808,"max":4,"id":0,"type":20},"kind":0,"type":1,"h":0,"o":0},"version":3},"desc":"说明: logo 将会发送到下面邮箱","editable":1}}
 *
 * 测试地址: http://localhost:3000/v5/activity/getActivityOrderDocInfo_v6_1?device=1&userId=1&orderId=1906
 * */
function getActivityOrderDocInfo_v6_1(req, res, next) {
    var device = checkUtil.stringFromReq(req, 'device');
    var userId = checkUtil.numberFromReq(req, "userId") || 0;
    var actOrderId = checkUtil.numberFromReq(req, "orderId") || 0;

    activityUtil.getActOrderDocInfo_v6_1(actOrderId, function(err, data){
        if(err || !data) {
            console.log("/v5/activity.js [getActivityOrderDocInfo_v6_1] getActOrderDocInfo_v6_1 err: " + err);
            return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
        }
        return activityUtil.ret_func_json(1, CODE.OPERATION_SUCCESS, data, res);
    });
}
router.get('/getActivityOrderDocInfo_v6_1', getActivityOrderDocInfo_v6_1);
router.post('/getActivityOrderDocInfo_v6_1', getActivityOrderDocInfo_v6_1);

/**
 * 更新用户秒杀资料信息
 *
 * 参数: device	"0 表示从pc来的请求
 * 1 标识一键生成iOS端
 * 2 标识一键生成android端
 * 3  标识一键生成 app 嵌入网页
 * 4 标识一键生成 web 端
 * 5 标识一键生成微信端
 *
 * 101 表示pc美化大师/102表示pc wps/103表示wps android/104表示wps ios
 * 201 标识利楚商务
 * 301 标识酒单网"
 * 参数: userId	 用户唯一标识
 * 参数: orderId	 秒杀订单id
 * 参数: info	/v5/activity/getActivityOrderDocInfo_v6_1 返回的 coreStructure填写完信息后转成的 json 字符串
 *
 * 测试地址: http://localhost:3000/v5/activity/updateActivityOrderDocInfo_v6_1?device=1&userId=415198&orderId=1964&info=QWERRTT
 * */
function updateActivityOrderDocInfo_v6_1(req, res, next) {
    var device = checkUtil.stringFromReq(req, 'device');
    var userId = checkUtil.numberFromReq(req, "userId") || 0;
    var orderId = checkUtil.numberFromReq(req, "orderId") || 0;
    var info = checkUtil.stringFromReq(req, 'info');

    if(userId <= 0 || orderId.length <=0 || !info || info.length <= 0) {
        return activityUtil.ret_func_json(0,'参数错误', {}, res);
    }
    activityUtil.updateActivityOrderDocInfo_v6_1(userId, orderId, info, function(err, data){

        if(err) {
            console.log('/v5/activity.js [updateActivityOrderDocInfo_v6_1] updateActivityOrderDocInfo_v6_1 err: ' + err);
            return activityUtil.ret_func_json(0, CODE.OPERATION_FAILED, {}, res);
        }
        return activityUtil.ret_func_json(1, CODE.OPERATION_SUCCESS, data || {}, res);
    });
}
router.get('/updateActivityOrderDocInfo_v6_1', updateActivityOrderDocInfo_v6_1);
router.post('/updateActivityOrderDocInfo_v6_1', updateActivityOrderDocInfo_v6_1);


//------------------------------------------------------------------------------------------------
module.exports = router;